package com.zuihai.app.mvp.contract;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import com.zuihai.app.mvp.model.entity.BaseJson;
import com.zuihai.app.mvp.model.entity.FindItem;
import com.zuihai.app.mvp.model.entity.HomeItem;
import com.zuihai.app.mvp.model.entity.MyFootCollectCheckResult;
import com.zuihai.app.mvp.model.entity.SearchHistory;
import com.zuihai.app.mvp.model.entity.SearchHot;
import com.zuihai.app.mvp.ui.adapter.SearchHistoryAdapter;
import com.zuihai.app.mvp.ui.adapter.SearchHotAdapter;
import com.zuihai.app.mvp.ui.utils.DividerListItemDecoration;

import java.util.List;

import rx.Observable;

/**
 * Created by Administrator on 2017/5/6 0006.
 */

public interface SearchRecyclerContract {
    //对于经常使用的关于UI的方法可以定义到BaseView中,如显示隐藏进度条,和显示文字消息
    interface View extends IView {
        void bindHotRecycler(SearchHotAdapter adapter);
        void bingHistoryRecycler(SearchHistoryAdapter adapter);
        void bindSearchRecycler(BaseQuickAdapter adapter, DividerListItemDecoration divider);
        int getType();
        void isEmpty();
        void isNotEmpty();
    }

    //Model层定义接口,外部只需关心model返回的数据,无需关心内部细节,及是否使用缓存
    interface Model extends IModel {
        Observable<BaseJson<SearchHot>> getSearchHot();
        Observable<List<SearchHistory>> getSearchHistory();
        Observable<BaseJson<HomeItem>> searchHeadline(String searchStr, String userId, int pageIndex);
        Observable<BaseJson<FindItem>> searchSecret(String searchStr, String userId, int pageIndex);
        Observable<BaseJson<FindItem>> searchCommodity(String searchStr, String userId, int pageIndex);
        Observable<BaseJson<FindItem>> searchShop(String searchStr, String userId, int pageIndex);
        Observable<BaseJson<MyFootCollectCheckResult>> searchAll(String searchStr, String userId, int pageIndex);
    }
}